package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable15;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable15.UserBaseTable15DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable15.vo.*;

/**
 * 完成住宅抵押 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable15Mapper extends BaseMapperX<UserBaseTable15DO> {

    default PageResult<UserBaseTable15DO> selectPage(UserBaseTable15PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable15DO>()
                .eqIfPresent(UserBaseTable15DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable15DO::getOwnership, reqVO.getOwnership())
                .eqIfPresent(UserBaseTable15DO::getArea, reqVO.getArea())
                .eqIfPresent(UserBaseTable15DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable15DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable15DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable15DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .likeIfPresent(UserBaseTable15DO::getCellName, reqVO.getCellName())
                .betweenIfPresent(UserBaseTable15DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable15DO::getId));
    }

    default List<UserBaseTable15DO> selectList(UserBaseTable15ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable15DO>()
                .eqIfPresent(UserBaseTable15DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable15DO::getOwnership, reqVO.getOwnership())
                .eqIfPresent(UserBaseTable15DO::getArea, reqVO.getArea())
                .eqIfPresent(UserBaseTable15DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable15DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable15DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable15DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .likeIfPresent(UserBaseTable15DO::getCellName, reqVO.getCellName())
                .betweenIfPresent(UserBaseTable15DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable15DO::getId));
    }

}
